home *** CD-ROM | disk | FTP | other *** search
/ Shareware Grab Bag / Shareware Grab Bag.iso / 007 / signal.arc / SYSINT.A < prev    next >
Text File  |  1985-07-26  |  2KB  |  55 lines

  1.  
  2. ;
  3. ; sysint -- system interrupt call
  4. ;
  5. ; Tom Poindexter, October 1983
  6. ;
  7. ; struct regval {int ax, bx, cx, dx, si, di, ds, es;} input_regs, output_regs;
  8. ;
  9. ; int int_vec;
  10. ;
  11. ; sysint(int_vec, &input_regs, &output_regs)
  12. ;
  13.         cseg
  14.         public  sysint_
  15.  
  16. sysint_:
  17.         push    bp                      ; standard
  18.         mov     bp,sp                   ;       prolog
  19.         push    ds                      ; C data seg
  20.  
  21.         mov     ax,[bp+4]               ; get interrupt #
  22.         mov     cs:intcal+1,al          ; modify int
  23.  
  24.         push    bp                      ; save for after int
  25.         mov     bp,[bp+06]              ; point to input_regs
  26.         mov     ax,[bp+00]
  27.         mov     bx,[bp+02]
  28.         mov     cx,[bp+04]
  29.         mov     dx,[bp+06]
  30.         mov     si,[bp+08]
  31.         mov     di,[bp+10]
  32.         mov     ds,[bp+12]
  33.         mov     es,[bp+14]
  34.  
  35. intcal:
  36.         int     255                     ; call the interrupt
  37.  
  38.         pop     bp                      ; restore parameter pointer
  39.         pushf                           ; save flags for return
  40.         mov     bp,[bp+08]              ; point to output_regs
  41.         mov     [bp+14],es
  42.         mov     [bp+12],ds
  43.         mov     [bp+10],di
  44.         mov     [bp+08],si
  45.         mov     [bp+06],dx
  46.         mov     [bp+04],cx
  47.         mov     [bp+02],bx
  48.         mov     [bp+00],ax
  49.  
  50.         pop     ax                      ; flags into ax
  51.  
  52.         pop     ds                      ; recover data seg
  53.         pop     bp                      ; standard
  54.         ret                             ;       epilog
  55.